package com.akkainaction.remote.createremoteactor.byapi;

import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.actor.UntypedActor;
import com.typesafe.config.ConfigFactory;

public class UserServerActor extends UntypedActor {

    @Override
    public void onReceive(Object msg) throws Exception {
        if(msg instanceof String){
            System.out.println(msg);
            //向发送者返回一条消息
            getSender().tell("hello sender.....",getSelf());
        }else {
            unhandled(msg);
        }
    }

    public static void main(String[] args) {
        ActorSystem.create("sys", ConfigFactory.load("remote-server.conf"));
    }
}
